<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta content="telephone=no" name="format-detection" />
	<meta http-equiv="Cache-Control" content="no-cache"/>
	<meta name="MobileOptimized" content="320">
	<!-- uc强制竖屏 -->
	<meta name="screen-orientation" content="portrait">
	<!-- QQ强制竖屏 -->
	<meta name="x5-orientation" content="portrait">
	<!-- UC强制全屏 -->
	<meta name="full-screen" content="yes">
	<!-- QQ强制全屏 -->
	<meta name="x5-fullscreen" content="true">
	<!-- UC应用模式 -->
	<meta name="browsermode" content="application">
	<!-- QQ应用模式 -->
	<meta name="x5-page-mode" content="app">
	<link rel="stylesheet" href="/Public/App/css/reset.css">
	<link rel="stylesheet" href="/Public/App/css/submit.css">
	<link rel="stylesheet" href="/Public/App/css/simpScroller.css">
	<script type="text/javascript" src="/Public/App/js/viewport.js"></script>
	<script type="text/javascript" src="/Public/App/js/simpScroller-min.js"></script>
	<script type="text/javascript" src="/Public/App/js/submit.js"></script>
    <script type="text/javascript" src="/Public/App/js/jquery.js"></script>

	<title>在线订餐</title>
</head>
<body>
		<header>
			<h1>提交订单</h1>
		</header>


        <form action="<?php echo U('');?>" method="post">
			<div class="warning">
				<span>请设置用户地址</span>
			</div>
			<div class="add-address clearfix">
				<div class="add-img">
					<img src="/Public/App/images/add.jpg" alt="">
				</div>
                <span class="address-span">添加送货地址</span>
				<span class="arrow">></span>
			</div>
			<div class="menu">
				<ul>
					<?php if(is_array($datas)): $i = 0; $__LIST__ = $datas;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li>
						<div class="food-img">
							<img src="<?php echo ($v["image"]); ?>" alt="">
						</div>
						<span class="name"><?php echo ($v["gname"]); ?></span>
						<span class="amount">x<?php echo ($v["goods_number"]); ?></span>
						<span class="one-price">￥<?php echo ($v["price"]); ?></span>
					</li><?php endforeach; endif; else: echo "" ;endif; ?>

				</ul>
			</div>
			<div class="remark">

					<input type="text" placeholder="备注：可注明口味，偏好等其他要求" name="remark" style="width: 100%;text-align: center;font-size: 34px">

			</div>
			<div class="man-amount">
				<span class="span1">就餐人数</span>
				<input type="text" class="input-amount" name="people">
			</div>
			<div class="freight">
				<span class="span1">配送费</span>
				<span class="span2 gray">10.00元</span>
			</div>
			<div class="lowest-freight">
				<span>最低起送价（不含配送费）</span>	
			</div>
			<div class="favourable-price">
				<span class="span1">优惠</span>
				<span class="span2 gray">0.00元</span>
			</div>
			<div class="original-price">
				<span class="span1">原价</span>
				<span class="span2 gray"><?php echo ($money); ?>元</span>
			</div>
			<div class="total">
				<span class="span1">合计</span>
				<span class="span2 gray">￥<?php echo ($money); ?></span>
			</div>
			<div class="pay-info">
				<span>支付信息</span>
			</div>
			<div class="pay-weichat">
				<span>微信支付</span>
				<div class="dot1"></div>
			</div>
			<div class="pay-cash">
				<span>现金支付</span>
				<div class="dot2"></div>
			</div>

		<footer class="clearfix">
			<div class="price">
				<span class="span-price">￥<?php echo ($money); ?></span>
                <input type="hidden" value="<?php echo ($money); ?>" name="price"/>
			</div>
			<div class="pay-btn"><button class="pay-button" type="submit">微信支付</button></div>
		</footer>

		<div class="address-layer">
			<div class="contacts-top">
				<span>联系人</span>
				<span class="exit1">x</span>
			</div>
			<div class="contact">
				<span>姓名：</span>
				<input type="text" placeholder="请填写收货人姓名" class="name-input" name="name">
				<br>
				<span>电话：</span>
				<input type="text" placeholder="请填写收货人手机号码" class="phone-input" name="tel">
				<br>
				<span>地址：</span>
				<input type="text" placeholder="请填写收货人详细地址" class="address-input" name="address">
			</div>
			<button class="save">保存</button>
		</div>

		<div class="address-box">
			<div class="address-top">
				<span>选择地址</span>
				<span class="exit2">x</span>
			</div>
			<div class="save-address">
				<ul class="ul-address">
                    <?php if(!empty($datas)): if(is_array($adr)): $i = 0; $__LIST__ = $adr;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><span class="zi" style="display: inline"><?php echo ($v["name"]); echo ($v["tel"]); ?></span>
            <button type="button" id="z<?php echo ($v["id"]); ?>" onclick="edit(this)" class="conf">
            选择它</button>
            <span class="shu" style="display: none"><?php echo ($v["id"]); ?></span></li><?php endforeach; endif; else: echo "" ;endif; ?>    <?php else: endif; ?></ul>	</div>		</div>
            <input type="hidden" class="adrr" name="aid"/>
        </form>
</body>
<script>
    function edit(a){
        var id = $(a).attr('id');                                  //这里可以拿到这个序号的id了
        var tex=$(a).prev('.zi').text();
        var num=$(a).next('.shu').text();
        $(".adrr").val(num);
        $(".address-span").html(tex);
        $(".address-box").css('display','none');
    }
</script>

</html>